package com.jsy.mini12306.common.util;

import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

/**
 * @author: SongyangJi
 * @description:
 * @since: 2021/9/3
 */
public class StringToLocalDateTimeUtil {
    static DateTimeFormatter dtfDateTime = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    static DateTimeFormatter dtfDate = DateTimeFormatter.ofPattern("yyyy-MM-dd");
    static DateTimeFormatter dtfTime = DateTimeFormatter.ofPattern("HH:mm:ss");

    public static LocalTime convertStringToLocalTime(String timeSequence) {
        return LocalTime.parse(timeSequence, dtfDateTime);
    }

    public static LocalTime convertStringToLocalTimeWithTimePattern(String timeSequence) {
        return LocalTime.parse(timeSequence, dtfTime);
    }

}
